package com.ynkbny.web.controller;

import com.ynkbny.service.impl.YnBkService;
import com.ynkbny.util.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 杨亚
 * @version 1.0.0
 * @title YnBkController
 * @description <ToDo description class purpose>
 * @create 2023/11/20 15:53
 **/
@Api(tags = "老狗平台博可接口服务")
@RestController
@RequestMapping("/ynkbny")
public class YnBkController {

    @Resource
    private YnBkService ynBkService;

    /**
     * 根据项目ID获取项目分析列表
     * @param projectId 项目ID
     * @return 项目分析列表
     */
    @ApiOperation("根据项目ID获取项目分析列表")
    @PostMapping("/getProjectAnaListBypProjectId")
    public Res<List<String>> getProjectAnaListBypProjectId(String projectId) {
        return Res.ok(ynBkService.getProjectAnaListBypProjectId(projectId));
    }

    /**
     * 根据设备ID获取设备分析列表
     * @param deviceId 设备ID
     * @return 设备分析列表
     */
    @ApiOperation("根据设备ID获取设备分析列表")
    @PostMapping("/getDeviceAnaListByDeviceId")
    public Res<List<String>> getDeviceAnaListByDeviceId(String deviceId) {
        return Res.ok(ynBkService.getDeviceAnaListByDeviceId(deviceId));
    }
}
